package util

import (
	"crypto/rand"
	"encoding/hex"
	"io"
)

func NewRandString() string {
	var uuid [16]byte
	_, err := io.ReadFull(rand.Reader, uuid[:])
	if err != nil {
		return ""
	}
	return hex.EncodeToString(uuid[:])
}

type UUID [16]byte

func NewRandByte() UUID {
	var uuid UUID
	_, err := io.ReadFull(rand.Reader, uuid[:])
	if err != nil {
		return uuid
	}
	return uuid
}
